<template>
    <div>
     <h3>列表显示</h3>
    查找会员<input type="text" v-model="names.name"><input type="button" value="查找" @click="ok">
   <table>
    <tbody>
        <tr>
            <td>会员名称</td>
            <td>手机号</td>
            <td>会员级别</td>
            <td>会员资产</td>
            <td>累计消费</td>
            <td>到店次数</td>
            <td>上次消费</td>
            <td>操作</td>
        </tr>
        <tr v-for="item in login" :key="item.id">
            <td>{{ item.name }}</td>
            <td>{{ item.tel }}</td>
            <td>{{ item.style }}</td>
            <td>{{ item.money }}</td>
            <td>{{ item.lmoney }}</td>
            <td>{{ item.num }}</td>
            <td>{{ item.lostmoney }}</td>
            <td>操作</td>
        </tr>
    </tbody>
   </table>
    </div>
</template>

<script setup lang="ts">
import axios from 'axios';
import { ref,reactive,onMounted } from "vue";
import moment from 'moment';
import { useRouter,useRoute } from "vue-router";
const router = useRouter();
const route = useRoute();

let names:any=reactive(
    {
name:"",
}
)
onMounted(()=>{
    ok();
})
let login: any = ref([])
const ok=()=>{
  
    axios({
        url:'https://localhost:7238/api/Emp/showshop',
        method:'get',
        params:names
    })
    .then(res=>{
        console.log(res);
        login.value = res.data
    })
    .catch(err=>{
        console.log(err);
    })
}



</script>

<style scoped>

</style>